home *** CD-ROM | disk | FTP | other *** search
/ .net (French) 1996 November / .net Magazine (FR) - Issue 01 - Nov 1996.iso / mac / Outils / Compression ⁄ Encodage / uuUndo 1.0 ƒ / uuUndo notes < prev   
Text File  |  1994-11-07  |  11KB  |  104 lines

  1. uuUndo
  2. a fast, free batch uudecoding utility
  3.  
  4. written by Aaron Giles (giles@med.cornell.edu)
  5. version 1.0, 7 November 1994
  6.  
  7.  
  8. Overview
  9.  
  10. This is the first official release of uuUndo, a fast, free batch uudecoding utility for the Macintosh.  Although uuUndo was originally designed to work with John Norstad╒s NewsWatcher, it does quite nicely in its own right as a standalone drag and drop smart uudecoder.
  11.  
  12. uuUndo is shipped as a fat binary, running incredibly quickly on PowerPC machines, and makes full use of asynchronous I/O to ensure smooth operation in the background.  Because it is based on Leonard Rosenthal╒s DropShell code, uuUndo is also fully scriptable and recordable.  uuUndo requires System 7.
  13.  
  14. If you find any bugs or have any comments, please email me at giles@med.cornell.edu.  Thank you.
  15.  
  16.  
  17. About uuencoding
  18.  
  19. uuUndo works with uuencoded files.  uuencoding is a common format on non-Macintosh systems which accomplishes the same thing that BinHex does on the Macintosh; that is, it is designed to allow a binary data file to be stored as text and thus included in mail and news messages.  Unlike the BinHex format, however, there is no integrity checking built into uuencoding, so there is absolutely no guarantee that a file has been decoded properly.  Be careful!
  20.  
  21.  
  22. Design Limitations
  23.  
  24. uuUndo was designed from the start to accept uuencoded text files ╤ possibly interspersed with header lines and other miscellaneous junk ╤ and translate them into their original binary format.  As such, it assumes that the file contains ALL of the original uuencoded data stored in the proper order.
  25.  
  26. What this means is that you cannot save several parts of a uuencoded file to three separate files and expect uuUndo to know what to do with them.  It also means that you cannot save a bunch of unordered parts to the same file and expect to get the proper result.  You must save all parts of a uuencoded file to the same file and in order.  If you are using NewsWatcher, this is done for you automatically. 
  27.  
  28.  
  29. Operation
  30.  
  31. uuUndo╒s general operation should be pretty straightforward: you can either drag and drop uuencoded files onto the uuUndo icon in the Finder, or you can manually open up the uuUndo application, choose uuDecode File... from the File menu, and choose which file you wish to decode.
  32.  
  33. (Quick tip:  If you are using NewsWatcher to decode a number of binaries, you might want to consider launching uuUndo first, before extracting.  This prevents uuUndo from quitting and relaunching between files, and makes overall operation much smoother.)
  34.  
  35.  
  36. Duplicate Files
  37.  
  38. If the file which is created through the uudecoding process already exists, a new name is algorithmically generated by adding a ╥.0╙ to the end of the file name.  In the event of a further conflict, the last character incremented until a unique name is found.
  39.  
  40.  
  41. Preferences for Extension Mapping
  42.  
  43. Unlike BinHex files, uuencoded files do not contain all the information needed to determine what type of file they are, or which application should be used to open them.  In order to get around this, uuUndo comes with some flexible extension mapping capabilities; this means that uuUndo will examine the last part of the file's name (the ╥extension╙), and from that guess which icon to give the new file.  For example, filenames ending in ╥.GIF╙ get automatically mapped to JPEGView╒s GIF icon.
  44.  
  45. Although uuUndo contains an internal list of which extensions should get mapped to which icons, it is often useful to be able to add your own extension types or to change which icon a given file extension will map to.  To do this in uuUndo, you will need to open up uuUndo╒s Preferences screen.  Do this by choosing Preferences... from the File menu. 
  46.  
  47. What you get when you do this is a window dominated by a list box on the left hand side.  This list contains all the extensions uuUndo currently knows about, along with the creator and type codes, and the icon associated with that extension.  You can scroll through this list, select items (one at a time only), and generally do what you╒re used to doing with lists of this sort.  Note that when you click on an item in the list, the extension, creator code, type code, and icon all get displayed in the area at the right; in addition, the name of the application matching the given creator code is displayed.
  48.  
  49. But wait a second...I know what you╒re thinking!  You╒re thinking, ╥You keep talking about these creator and type codes ╤ but what exactly ARE they?╙  Well, briefly, every file in the Macintosh file system has a pair of these four-character codes, and together these codes serve to indicate to the Finder which icon it should display.  For a full explanation, see the section Creator and Type Codes, later in this document.
  50.  
  51. To modify the mapping of an extension which already is in the list, you need only double-click on the extension in the list, or else select the extension and click the Edit button.  When you do this, boxes will appear around the items on the right (except for the application name, which is just displayed for informational purposes).  You can then type in the extension (up to 5 characters total, including the period), and the creator and type codes.  Click the Done button, or anywhere in the extension list to save your changes.
  52.  
  53. But what if you don╒t know what the creator and type codes are?  Well, that╒s easy.  When you begin editing an extension, you will see the Find Example Icon... button become enabled.  Click this button, and you will be presented with the standard mechanism for selecting a file.  Simply choose a file on your hard drive whose icon matches the one you wish to map the current extension to, and the creator and type values will automatically be extracted and set for you.
  54.  
  55. In addition, if you are running System 7.5, or if you have the Macintosh Drag and Drop extension installed on your system and are running System 7.1.2 or later, you can accomplish the same thing in a more elegant way.  Simply use the Finder to locate an example of the icon you wish, and drag the icon into the icon box in the uuUndo Preferences window.  As you do this, the inside of the box will highlight, and when you let go of the mouse button, the creator and type of the current extension will be set to the creator and type of the icon you dragged from the Finder.
  56.  
  57. You can also add new extensions onto the end of the list by clicking in the New button, or delete superfluous extensions by selecting an item in the list and clicking the Delete button.  When you are finished, simply close the uuUndo Preferences window, and all your changes will be saved.
  58.  
  59.  
  60. Other Preferences
  61.  
  62. By default, uuUndo will leave the original uuencoded file alone when it is finished.  This allows you to try again in case the decoding didn╒t work quite right (remember that there is no way for uuUndo to know whether everything worked!)  However, as a convenience, uuUndo can automatically move files into the trash can or delete them as they are processed.  To use these features, choose a different option from the popup menu at the bottom of uuUndo╒s preferences screen.   The three available options are leave source file alone, move source file to the trash, and delete source file immediately.
  63.  
  64.  
  65. Creator and Type Codes
  66.  
  67. A creator code is associated with a particular application; for instance, JPEGView╒s creator code is 'JVWR', and SimpleText╒s creator code is 'ttxt'.  On the other hand, a type code serves to indicate what type of data the file contains; for instance a text file has a type of 'TEXT', and a GIF file has a type of 'GIFf'.  It is important to note that both creator and type codes are case-sensitive; that is, 'giff' is different than 'GIFf'.
  68.  
  69. Another important thing to realize is that one creator code can be associated with several type codes, and vice-versa.  As an example, consider the application SimpleText, which has a creator type of 'ttxt'.  SimpleText can open three types of files (actually more, but we╒ll leave it at three for this example): text files ('TEXT'), read-only text files ('ttro'), and pictures ('PICT').  To get SimpleText╒s text file icon, you should set the creator and type to 'ttxt' and 'TEXT', respectively.  To get SimpleText╒s picture file icon, you use 'ttxt' and 'PICT'.
  70.  
  71. On the other hand, SimpleText isn╒t the only application that can open text and picture files.  You can open text files in BBEdit as well, and BBEdit╒s creator code is 'R*ch' (remember, types are case sensitive!).  So to get the text file icon for BBEdit instead of SimpleText, you would use a creator code of 'R*ch' instead of 'ttxt'.
  72.  
  73.  
  74. Change History
  75.  
  76. 1.0:
  77.     Ñ fixed another bug which would prevent files from being moved into the trash
  78.     Ñ restored the option to delete files immediately
  79.  
  80. 1.0b4:
  81.     Ñ fixed a bug which would prevent files from being moved into the trash if the trash already contained a file with the same name
  82.  
  83. 1.0b3:
  84.     Ñ fixed a really stupid bug which would sometimes (often?) corrupt the extension mapping preferences; if you fell victim to this, you can get the defaults back by deleting your uuUndo preferences file (in the Preferences folder in your System Folder)
  85.  
  86. 1.0b2:
  87.     Ñ added the uuUndo preferences screen, allowing you to edit the extension mapping uuUndo does.  The resource format is the same as before, but it is stored in the uuUndo Preferences file; uuUndo╒s default mapping is still stored in the application╒s resource fork
  88.     Ñ changed the option to delete the source file to only move the file to the trash.  This accomplishes mostly the same thing, and lets you get back to any damaged files to examine them by hand
  89.     Ñ the progress window now displays the name of the output file, rather than the input file name
  90.     Ñ fixed the bug which crashed non-Color QuickDraw-capable machines (though the new preferences code may still have some problems yet...)
  91.  
  92. 1.0b1:
  93.     Ñ first public release; essentially just 1.0a2 repackaged
  94.  
  95. 1.0a2:
  96.     Ñ IMPORTANT NOTE: If you are running System 7.5b2, and you have the Apple Menu Options control panel installed, you cannot drag and drop files from a mounted file server without crashing.  I don't know why this is happening, but it is definitely a conflict caused by a patch the Apple Menu Options CP makes
  97.     Ñ all disk I/O is now done asynchronously, and the central I/O during decoding is implemented using a fancy double-buffering scheme.  This scheme enables us to be decoding one half of the input buffer as the other half is being read in, and similarly half of the output buffer can be written as the other half is being decoded into.  I have realized an overall speed increase on my PowerPC of about 15%.  But more importantly, all the asynchronous I/O allows other applications to operate more smoothly while uuUndo is churning away in the background
  98.     Ñ The keyword "end" must now be on a line all by itself to be recognized.  This prevents certain lines like "end part 1" from tricking uuUndo into thinking that it had reached the end of the uuencoded data
  99.     Ñ File extension mapping is now done *before* long names get truncated, so that really long names have a chance of getting properly mapped
  100.     Ñ The appropriate menus are now dimmed during a decode operation
  101.     Ñ the cursor is reset to an arrow when a context switch is done
  102.  
  103. 1.0a1:
  104.     Ñ initial release